home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Tele / Pete Johnson / Log-O-Matic 1.72<source> Folder / ConfigLOM.p < prev    next >
Encoding:
Text File  |  1991-01-22  |  23.5 KB  |  786 lines  |  [TEXT/PJMM]

  1. unit ConfigureLOM;
  2.  
  3. interface
  4.  
  5.     uses
  6.         Globals, HelloTabby;
  7.  
  8.     procedure ConfigureDialog;
  9.  
  10. implementation
  11.  
  12.     var
  13.         theDialog: DialogPtr;
  14.  
  15.     const
  16.         configureDlog = 1002;
  17.         nextLaunchStr = 500;            { Resource type: STR  }
  18.         defaultsStr = 501;
  19.         BackupPathStr = 504;
  20.         veteranStr = 505;
  21.         flagStr = 506;
  22.         textTypeStr = 507;
  23.         levelToDeleteStr = 508;
  24.         promotionStr = 509;
  25.         tabbyLogArchLimitStr = 510;
  26.         oneCallLimitStr = 511;
  27.         deleteOldUsersStr = 512;
  28.         checkLevelStr = 513;
  29.  
  30. {    -----------------------------------------------------------------}
  31.  
  32.     procedure FrameDItem (dLog: DialogPtr; iNum: integer);
  33.  
  34.         var
  35.             iBox: Rect;
  36.             iType: integer;
  37.             iHandle: Handle;
  38.             oldPenState: PenState;
  39.  
  40.     begin
  41.         GetPenState(oldPenState);
  42.         GetDItem(dLog, iNum, iType, iHandle, iBox);
  43.         InsetRect(iBox, -4, -4);
  44.         PenSize(3, 3);
  45.         FrameRoundRect(iBox, 16, 16);
  46.         SetPenState(oldPenState)
  47.     end;
  48.  
  49. {-----------------------------------------------------------------    }
  50.  
  51.     procedure MakePath (FName: STR255; VRefNum: integer; var MyPath: STR255);
  52.  
  53.         var
  54.             MyPB: CInfoPBRec;
  55.  
  56.     begin
  57.         MyPath := '';
  58.         MyPB.ioCompletion := nil;
  59.         MyPB.ioNamePtr := @FName;
  60.         MyPB.ioVRefNum := VRefNum;
  61.         MyPB.ioFDirIndex := 0;
  62.         MyPB.ioDirID := 0;
  63.         Err := PBGetCatInfo(@MyPB, false);
  64.         MyPB.ioFDirIndex := -1;                    {}
  65.         MyPB.ioDirID := MyPB.ioDRParID;
  66.         while PBGetCatInfo(@MyPB, false) = NoErr do
  67.             begin
  68.                 MyPath := concat(MyPB.ioNamePtr^, ':', MyPath);
  69.                 MyPB.ioDirID := MyPB.ioDRParID;
  70.                 MyPB.ioFDirIndex := -1;
  71.             end;        {    while PBGetCatInfo(@MyPB, false) = NoErr    }
  72.     end;
  73.  
  74. {    -----------------------------------------------------------------}
  75.  
  76.     procedure ConfigureDialog;
  77.  
  78.         const
  79.             Unselected = 0;
  80.             Active = 0;
  81.             Inactive = 255;
  82.             Selected = 1;
  83.             OKButton = 1;            { Configure Dialog Items }
  84.             CancelButton = 2;
  85.             NextLaunchField = 3;
  86.             DeleteLevelField = 4;
  87.             CheckLevelField = 5;
  88.             NecomerField = 6;
  89.             ApprovedLevelField = 7;
  90.             ApprovedTimeField = 8;
  91.             InactivityField = 9;
  92.             OneCallLimitField = 10;
  93.             AfterCallsField = 11;
  94.             VeteranFlagField = 12;
  95.             TEXTTypeField = 13;
  96.             TabbyLimitSizeField = 14;
  97.             BackUpSwitch = 15;
  98.             DeleteByLevelSwitch = 16;
  99.             SortUserlogSwitch = 17;
  100.             ZeroMinSwitch = 18;
  101.             ResetCLSwitch = 19;
  102.             ResetTLSwitch = 20;
  103.             VersionField = 21;
  104.             ChangeLevelSwitch = 23;
  105.             TabbyLimitSwitch = 27;
  106.             MonthlyCLArcSwitch = 28;
  107.             DeleteOldUsersSwitch = 29;
  108.             SkipDeletesSwitch = 31;
  109.             LogDeletesSwitch = 32;
  110.             KillOneTimersSwitch = 33;
  111.             MonthlyTLArcSwitch = 36;
  112.             VeteranCallerSwitch = 37;
  113.             FlagSetRadio = 39;
  114.             FlagClearRadio = 40;
  115.             TabbyKLimitRadio = 43;
  116.             TabbyDayLimitRadio = 44;
  117.             BackupPathField = 49;
  118.             FindButton = 50;
  119.             StuffItSwitch = 52;
  120.  
  121.         var
  122.             DefaultString: str255;
  123.             thisButton: ControlHandle;
  124.             ResHandle2: Handle;
  125.             StringCount: integer;
  126.             where: point;
  127.             fileReply: SFReply;
  128.             ItemHit, itemType, whichItem: integer;
  129.             itemHandle: Handle;
  130.             dispRect: Rect;
  131.  
  132.         procedure AdjustSwitch (whichSwitch: integer; Setting: boolean);
  133.  
  134.         begin
  135.             getDItem(theDialog, whichSwitch, itemType, itemHandle, dispRect);
  136.             thisButton := ControlHandle(itemHandle);
  137.             if Setting then
  138.                 SetCtlValue(thisButton, Selected)
  139.             else
  140.                 SetCtlValue(thisButton, Unselected)
  141.         end;
  142.  
  143.         procedure AdjustActive (whichSwitch: integer; Setting: boolean);
  144.  
  145.         begin
  146.             getDItem(theDialog, whichSwitch, itemType, itemHandle, dispRect);
  147.             if Setting then
  148.                 begin
  149.                     HiliteControl(ControlHandle(itemHandle), Active);
  150.                     SetCtlValue(ControlHandle(itemHandle), Selected)
  151.                 end
  152.             else
  153.                 begin
  154.                     HiliteControl(ControlHandle(itemHandle), Inactive);
  155.                     SetCtlValue(ControlHandle(itemHandle), Unselected)
  156.                 end
  157.         end;
  158.  
  159.     begin
  160.         InitCursor;
  161.         theDialog := GetNewDialog(configureDlog, nil, POINTER(-1));                {IM I-413}
  162.         SetPort(theDialog);
  163.         FrameDItem(theDialog, Ok);
  164.         DrawDialog(theDialog);
  165.  
  166.         NextLaunch := GetString(nextLaunchStr)^^;        {    Get next launch string from resource    }
  167.         getDItem(theDialog, NextLaunchField, itemType, itemHandle, dispRect);
  168.         SetIText(itemHandle, NextLaunch);
  169.  
  170.         getDItem(theDialog, TEXTTypeField, itemType, itemHandle, dispRect);
  171.         SetIText(itemHandle, TEXTType);
  172.  
  173.         getDItem(theDialog, AfterCallsField, itemType, itemHandle, dispRect);
  174.         SetIText(itemHandle, VetCallsText);
  175.  
  176.         getDItem(theDialog, VeteranFlagField, itemType, itemHandle, dispRect);
  177.         SetIText(itemHandle, FlagNumText);
  178.  
  179.         getDItem(theDialog, BackupPathField, itemType, itemHandle, dispRect);
  180.         SetIText(itemHandle, BackupPath);
  181.  
  182.         getDItem(theDialog, BackupSwitch, itemType, itemHandle, dispRect);
  183.         thisButton := ControlHandle(itemHandle);
  184.         if Backup then
  185.             SetCtlValue(thisButton, Selected)
  186.         else
  187.             SetCtlValue(thisButton, Unselected);
  188.  
  189.         getDItem(theDialog, StuffItSwitch, itemType, itemHandle, dispRect);
  190.         thisButton := ControlHandle(itemHandle);
  191.         if UseStuffit then
  192.             SetCtlValue(thisButton, Selected)
  193.         else
  194.             SetCtlValue(thisButton, Unselected);
  195.  
  196.         getDItem(theDialog, DeleteByLevelSwitch, itemType, itemHandle, dispRect);
  197.         thisButton := ControlHandle(itemHandle);
  198.         if (not Backup) then
  199.             HiliteControl(thisButton, Inactive)
  200.         else
  201.             HiliteControl(thisButton, Active);
  202.         if DeleteByLevel then
  203.             SetCtlValue(thisButton, Selected)
  204.         else
  205.             SetCtlValue(thisButton, Unselected);
  206.  
  207.         getDItem(theDialog, DeleteLevelField, itemType, itemHandle, dispRect);
  208.         SetIText(itemHandle, DeleteLevelString);
  209.  
  210.         getDItem(theDialog, SkipDeletesSwitch, itemType, itemHandle, dispRect);
  211.         thisButton := ControlHandle(itemHandle);
  212.         if (not Backup) then
  213.             HiliteControl(thisButton, Inactive)
  214.         else
  215.             HiliteControl(thisButton, Active);
  216.         if SkipDeletes then
  217.             SetCtlValue(thisButton, Selected)
  218.         else
  219.             SetCtlValue(thisButton, Unselected);
  220.  
  221.         getDItem(theDialog, SortUserlogSwitch, itemType, itemHandle, dispRect);
  222.         thisButton := ControlHandle(itemHandle);
  223.         if SortUL then
  224.             SetCtlValue(thisButton, Selected)
  225.         else
  226.             SetCtlValue(thisButton, Unselected);
  227.  
  228.         getDItem(theDialog, ZeroMinSwitch, itemType, itemHandle, dispRect);
  229.         thisButton := ControlHandle(itemHandle);
  230.         if ZeroMin then
  231.             SetCtlValue(thisButton, Selected)
  232.         else
  233.             SetCtlValue(thisButton, Unselected);
  234.  
  235.         getDItem(theDialog, ResetCLSwitch, itemType, itemHandle, dispRect);
  236.         thisButton := ControlHandle(itemHandle);
  237.         if ResetCL then
  238.             begin
  239.                 SetCtlValue(thisButton, Selected);
  240.                 getDItem(theDialog, MonthlyCLArcSwitch, itemType, itemHandle, dispRect);
  241.                 HiliteControl(ControlHandle(itemHandle), Active);
  242.                 SetCtlValue(ControlHandle(itemHandle), Selected);
  243.                 MonthlyCLArc := true
  244.             end
  245.         else
  246.             begin
  247.                 SetCtlValue(thisButton, Unselected);
  248.                 getDItem(theDialog, MonthlyCLArcSwitch, itemType, itemHandle, dispRect);
  249.                 HiliteControl(ControlHandle(itemHandle), Inactive);
  250.                 SetCtlValue(ControlHandle(itemHandle), Unselected);
  251.                 MonthlyCLArc := false
  252.             end;
  253.  
  254.         getDItem(theDialog, ResetTLSwitch, itemType, itemHandle, dispRect);
  255.         thisButton := ControlHandle(itemHandle);
  256.         if ResetTL then
  257.             SetCtlValue(thisButton, Selected)
  258.         else
  259.             SetCtlValue(thisButton, Unselected);
  260.  
  261.         getDItem(theDialog, MonthlyTLArcSwitch, itemType, itemHandle, dispRect);
  262.         thisButton := ControlHandle(itemHandle);
  263.         if MonthlyTLArc then
  264.             SetCtlValue(thisButton, Selected)
  265.         else
  266.             SetCtlValue(thisButton, Unselected);
  267.  
  268.         getDItem(theDialog, ChangeLevelSwitch, itemType, itemHandle, dispRect);
  269.         thisButton := ControlHandle(itemHandle);
  270.         if (not Backup) then
  271.             HiliteControl(thisButton, Inactive)
  272.         else
  273.             HiliteControl(thisButton, Active);
  274.         if ChangeLevel then
  275.             SetCtlValue(thisButton, Selected)
  276.         else
  277.             SetCtlValue(thisButton, Unselected);
  278.  
  279.         getDItem(theDialog, NecomerField, itemType, itemHandle, dispRect);
  280.         SetIText(itemHandle, StringOf(Newcomer : 1));
  281.  
  282.         getDItem(theDialog, ApprovedLevelField, itemType, itemHandle, dispRect);
  283.         SetIText(itemHandle, StringOf(Approved : 1));
  284.  
  285.         getDItem(theDialog, ApprovedTimeField, itemType, itemHandle, dispRect);
  286.         SetIText(itemHandle, StringOf(NewTime : 1));
  287.  
  288.         getDItem(theDialog, TabbyLimitSwitch, itemType, itemHandle, dispRect);
  289.         thisButton := ControlHandle(itemHandle);
  290.         if (not ResetTL) then
  291.             HiliteControl(thisButton, Inactive)
  292.         else
  293.             HiliteControl(thisButton, Active);
  294.         if (TabbyLimit & ResetTL) then
  295.             SetCtlValue(thisButton, Selected)
  296.         else
  297.             SetCtlValue(thisButton, Unselected);
  298.  
  299.         getDItem(theDialog, TabbyLimitSizeField, itemType, itemHandle, dispRect);
  300.         SetIText(itemHandle, StringOf(TabbyLimitSize : 1));
  301.  
  302.         getDItem(theDialog, DeleteOldUsersSwitch, itemType, itemHandle, dispRect);
  303.         thisButton := ControlHandle(itemHandle);
  304.         if (not Backup) then
  305.             HiliteControl(thisButton, Inactive)
  306.         else
  307.             HiliteControl(thisButton, Active);
  308.         if Backup & (DeleteOldUsers | KillOldOneCalls) then
  309.             begin
  310.                 SetCtlValue(thisButton, Selected);
  311.                 getDItem(theDialog, InactivityField, itemType, itemHandle, dispRect);
  312.                 SetIText(itemHandle, StringOf(Inactivity : 1))
  313.             end
  314.         else
  315.             begin
  316.                 SetCtlValue(thisButton, Unselected);
  317.                 getDItem(theDialog, InactivityField, itemType, itemHandle, dispRect);
  318.                 SetIText(itemHandle, '');
  319.                 DeleteOldUsers := false
  320.             end;
  321.  
  322.         getDItem(theDialog, CheckLevelField, itemType, itemHandle, dispRect);
  323.         SetIText(itemHandle, CheckLevStr);
  324.  
  325.         getDItem(theDialog, LogDeletesSwitch, itemType, itemHandle, dispRect);
  326.         thisButton := ControlHandle(itemHandle);
  327.         if (not Backup) then
  328.             HiliteControl(thisButton, Inactive)
  329.         else
  330.             HiliteControl(thisButton, Active);
  331.         if (Backup & LogDeletes) then
  332.             SetCtlValue(thisButton, Selected)
  333.         else
  334.             SetCtlValue(thisButton, Unselected);
  335.  
  336.         getDItem(theDialog, VeteranCallerSwitch, itemType, itemHandle, dispRect);
  337.         thisButton := ControlHandle(itemHandle);
  338.         if (not Backup) then
  339.             HiliteControl(thisButton, Inactive)
  340.         else
  341.             HiliteControl(thisButton, Active);
  342.         if (Backup & AlterVeterans) then
  343.             SetCtlValue(thisButton, Selected)
  344.         else
  345.             SetCtlValue(thisButton, Unselected);
  346.  
  347.         AdjustSwitch(FlagSetRadio, SetTheFlag);
  348.         AdjustSwitch(FlagClearRadio, not SetTheFlag);
  349.  
  350.         AdjustSwitch(TabbyKLimitRadio, TLKLimit);
  351.         AdjustSwitch(TabbyDayLimitRadio, not TLKLimit);
  352.  
  353.         getDItem(theDialog, KillOneTimersSwitch, itemType, itemHandle, dispRect);
  354.         thisButton := ControlHandle(itemHandle);
  355.         if (not Backup) then
  356.             HiliteControl(thisButton, Inactive)
  357.         else
  358.             HiliteControl(thisButton, Active);
  359.         if (Backup & KillOldOneCalls) then
  360.             SetCtlValue(thisButton, Selected)
  361.         else
  362.             SetCtlValue(thisButton, Unselected);
  363.  
  364.         getDItem(theDialog, OneCallLimitField, itemType, itemHandle, dispRect);
  365.         SetIText(itemHandle, OneCallLimitString);
  366.  
  367.         TextFont(Geneva);
  368.         TextSize(9);
  369.         ForeColor(redColor);
  370.         getDItem(theDialog, VersionField, itemType, itemHandle, dispRect);
  371.         SetIText(itemHandle, concat('Version ', VERSION, ' of ', Compdate));
  372.         ForeColor(blackColor);
  373.         TextFont(0);
  374.         TextSize(12);
  375.  
  376.         if StillDown then
  377.             repeat
  378.             until not Button;
  379.         repeat
  380.             ModalDialog(nil, ItemHit);                                            {IM I-415}
  381.  
  382.             case ItemHit of
  383.                 1: { OK button hit -- save resources }
  384.                     begin
  385.                         getDItem(theDialog, NextLaunchField, itemType, itemHandle, dispRect);
  386.                         GetIText(itemHandle, NextLaunch);
  387.                         ResHandle2 := GetResource('STR ', nextLaunchStr);
  388.                         RmveResource(ResHandle2);
  389.                         UpdateResFile(CurrentResFile);
  390.                         AddResource(Handle(NewString(NextLaunch)), 'STR ', nextLaunchStr, 'Next Launch');
  391.  
  392.                         getDItem(theDialog, DeleteLevelField, itemType, itemHandle, dispRect);
  393.                         GetIText(itemHandle, DeleteLevelString);
  394.                         ResHandle2 := GetResource('STR ', levelToDeleteStr);
  395.                         RmveResource(ResHandle2);
  396.                         UpdateResFile(CurrentResFile);
  397.                         AddResource(Handle(NewString(DeleteLevelString)), 'STR ', levelToDeleteStr, 'Level To Delete');
  398.  
  399.                         DefaultString := 'YYYYYYYYYYYYSKS';    {    15 characters for 15 default switches        }
  400.  
  401.                         if not DeleteByLevel then
  402.                             DefaultString[1] := 'N';
  403.  
  404.                         if not SkipDeletes then
  405.                             DefaultString[2] := 'N';
  406.  
  407.                         if not Backup then
  408.                             DefaultString[3] := 'N';
  409.  
  410.                         if not ZeroMin then
  411.                             DefaultString[4] := 'N';
  412.  
  413.                         if not SortUl then
  414.                             DefaultString[5] := 'N';
  415.  
  416.                         if not ResetCL then
  417.                             DefaultString[6] := 'N';
  418.  
  419.                         if not ResetTL then
  420.                             DefaultString[7] := 'N';
  421.  
  422.                         if not MonthlyCLArc then
  423.                             DefaultString[8] := 'N';
  424.  
  425.                         if not LogDeletes then
  426.                             DefaultString[9] := 'N';
  427.  
  428.                         if not KillOldOneCalls then
  429.                             DefaultString[10] := 'N';
  430.  
  431.                         if not AlterVeterans then
  432.                             DefaultString[11] := 'N';
  433.  
  434.                         if not MonthlyTLArc then
  435.                             DefaultString[12] := 'N';
  436.  
  437.                         if not SetTheFlag then
  438.                             DefaultString[13] := 'C';
  439.  
  440.                         if not TLKLimit then
  441.                             DefaultString[14] := 'D';
  442.  
  443.                         if not UseStuffit then
  444.                             DefaultString[15] := 'N';
  445.  
  446.                         RmveResource(GetResource('STR ', defaultsStr));
  447.                         UpdateResFile(CurrentResFile);
  448.                         AddResource(Handle(NewString(DefaultString)), 'STR ', defaultsStr, 'Defaults');
  449.  
  450.                         if ChangeLevel then
  451.                             begin
  452.                                 PromotionString := 'Y';
  453.                                 getDItem(theDialog, NecomerField, itemType, itemHandle, dispRect);
  454.                                 GetIText(itemHandle, TempString);
  455.                                 for StringCount := 1 to length(TempString) do
  456.                                     if TempString[StringCount] in ['0'..'9'] then
  457.                                         PromotionString := concat(PromotionString, TempString[StringCount]);
  458.                                 if PromotionString[length(PromotionString)] = 'Y' then
  459.                                     PromotionString := concat(PromotionString, '0');
  460.                                 PromotionString := concat(PromotionString, ',');
  461.  
  462.                                 getDItem(theDialog, ApprovedLevelField, itemType, itemHandle, dispRect);
  463.                                 GetIText(itemHandle, TempString);
  464.                                 for StringCount := 1 to length(TempString) do
  465.                                     if TempString[StringCount] in ['0'..'9'] then
  466.                                         PromotionString := concat(PromotionString, TempString[StringCount]);
  467.                                 if PromotionString[length(PromotionString)] = ',' then
  468.                                     PromotionString := concat(PromotionString, '0');
  469.                                 PromotionString := concat(PromotionString, ',');
  470.  
  471.                                 getDItem(theDialog, ApprovedTimeField, itemType, itemHandle, dispRect);
  472.                                 GetIText(itemHandle, TempString);
  473.                                 for StringCount := 1 to length(TempString) do
  474.                                     if TempString[StringCount] in ['0'..'9'] then
  475.                                         PromotionString := concat(PromotionString, TempString[StringCount]);
  476.                                 if PromotionString[length(PromotionString)] = ',' then
  477.                                     PromotionString := concat(PromotionString, '0')
  478.                             end
  479.                         else
  480.                             PromotionString := 'N0,0,0';
  481.                         RmveResource(GetResource('STR ', promotionStr));
  482.                         UpdateResFile(CurrentResFile);
  483.                         AddResource(Handle(NewString(PromotionString)), 'STR ', promotionStr, 'Promotion');
  484.  
  485.                         if TabbyLimit then
  486.                             begin
  487.                                 if TLKLimit then
  488.                                     TempString := 'YK'
  489.                                 else
  490.                                     TempString := 'YD';
  491.                                 getDItem(theDialog, TabbyLimitSizeField, itemType, itemHandle, dispRect);
  492.                                 GetIText(itemHandle, TempString);
  493.                                 if TLKLimit then
  494.                                     TempString := concat('YK', TempString)
  495.                                 else
  496.                                     TempString := concat('YD', TempString)
  497.                             end
  498.                         else
  499.                             TempString := 'N0';
  500.                         RmveResource(GetResource('STR ', tabbyLogArchLimitStr));
  501.                         UpdateResFile(CurrentResFile);
  502.                         AddResource(Handle(NewString(TempString)), 'STR ', tabbyLogArchLimitStr, 'Tabby Log.Arch Limit');
  503.  
  504.                         if DeleteOldUsers then
  505.                             begin
  506.                                 getDItem(theDialog, InactivityField, itemType, itemHandle, dispRect);
  507.                                 GetIText(itemHandle, TempString);
  508.                                 TempString := concat('Y', TempString)
  509.                             end
  510.                         else
  511.                             TempString := 'N0';
  512.                         RmveResource(GetResource('STR ', deleteOldUsersStr));
  513.                         UpdateResFile(CurrentResFile);
  514.                         AddResource(Handle(NewString(TempString)), 'STR ', deleteOldUsersStr, 'Delete Old Users?');
  515.  
  516.                         getDItem(theDialog, CheckLevelField, itemType, itemHandle, dispRect);
  517.                         GetIText(itemHandle, TempString);
  518.                         RmveResource(GetResource('STR ', checkLevelStr));
  519.                         UpdateResFile(CurrentResFile);
  520.                         AddResource(Handle(NewString(TempString)), 'STR ', checkLevelStr, 'Check Level');
  521.  
  522.                         if KillOldOneCalls then
  523.                             begin
  524.                                 getDItem(theDialog, OneCallLimitField, itemType, itemHandle, dispRect);
  525.                                 GetIText(itemHandle, TempString)
  526.                             end
  527.                         else
  528.                             TempString := '0';
  529.                         RmveResource(GetResource('STR ', oneCallLimitStr));
  530.                         UpdateResFile(CurrentResFile);
  531.                         AddResource(Handle(NewString(TempString)), 'STR ', oneCallLimitStr, 'One-Call Limit');
  532.  
  533.                         getDItem(theDialog, TEXTTypeField, itemType, itemHandle, dispRect);
  534.                         GetIText(itemHandle, TempString);
  535.                         RmveResource(GetResource('STR ', textTypeStr));
  536.                         UpdateResFile(CurrentResFile);
  537.                         AddResource(Handle(NewString(TempString)), 'STR ', textTypeStr, 'TEXT Type');
  538.  
  539.                         getDItem(theDialog, AfterCallsField, itemType, itemHandle, dispRect);
  540.                         GetIText(itemHandle, TempString);
  541.                         RmveResource(GetResource('STR ', veteranStr));
  542.                         UpdateResFile(CurrentResFile);
  543.                         AddResource(Handle(NewString(TempString)), 'STR ', veteranStr, 'Veteran calls');
  544.  
  545.                         getDItem(theDialog, VeteranFlagField, itemType, itemHandle, dispRect);
  546.                         GetIText(itemHandle, TempString);
  547.                         RmveResource(GetResource('STR ', flagStr));
  548.                         UpdateResFile(CurrentResFile);
  549.                         AddResource(Handle(NewString(TempString)), 'STR ', flagStr, 'Veteran flag');
  550.  
  551.                         getDItem(theDialog, BackupPathField, itemType, itemHandle, dispRect);
  552.                         GetIText(itemHandle, TempString);
  553.                         RmveResource(GetResource('STR ', backupPathStr));
  554.                         UpdateResFile(CurrentResFile);
  555.                         AddResource(Handle(NewString(TempString)), 'STR ', backupPathStr, 'Backup Path');
  556.  
  557.                     end;    {OK Button}
  558.  
  559.                 Cancel: 
  560.                     ; { Cancel button hit—do nothing    }
  561.  
  562.                 BackupSwitch: 
  563.                     begin  { Backup switch    }
  564.                         Backup := not (Backup);
  565.                         getDItem(theDialog, BackupSwitch, itemType, itemHandle, dispRect);
  566.                         thisButton := ControlHandle(itemHandle);
  567.                         if Backup then
  568.                             begin
  569.                                 SetCtlValue(thisButton, Selected);
  570.                                 AdjustActive(DeleteByLevelSwitch, true);
  571.                                 DeleteByLevel := true;
  572.                                 AdjustActive(SkipDeletesSwitch, true);
  573.                                 SkipDeletes := true;
  574.                                 AdjustActive(ChangeLevelSwitch, true);
  575.                                 ChangeLevel := true;
  576.                                 AdjustActive(DeleteOldUsersSwitch, true);
  577.                                 DeleteOldUsers := true;
  578.                                 AdjustActive(LogDeletesSwitch, true);
  579.                                 LogDeletes := true;
  580.                                 AdjustActive(KillOneTimersSwitch, true);
  581.                                 KillOldOneCalls := true;
  582.                                 AdjustActive(VeteranCallerSwitch, true);
  583.                                 AlterVeterans := true
  584.                             end
  585.                         else
  586.                             begin
  587.                                 SetCtlValue(thisButton, Unselected);
  588.                                 AdjustActive(DeleteByLevelSwitch, false);
  589.                                 DeleteByLevel := false;
  590.                                 AdjustActive(SkipDeletesSwitch, false);
  591.                                 SkipDeletes := false;
  592.                                 AdjustActive(ChangeLevelSwitch, false);
  593.                                 ChangeLevel := false;
  594.                                 AdjustActive(DeleteOldUsersSwitch, false);
  595.                                 DeleteOldUsers := false;
  596.                                 AdjustActive(LogDeletesSwitch, false);
  597.                                 LogDeletes := false;
  598.                                 AdjustActive(KillOneTimersSwitch, false);
  599.                                 KillOldOneCalls := false;
  600.                                 AdjustActive(VeteranCallerSwitch, false);
  601.                                 AlterVeterans := true
  602.                             end
  603.                     end;
  604.  
  605.                 DeleteByLevelSwitch: 
  606.                     begin  { DeleteByLevel switch    }
  607.                         DeleteByLevel := not DeleteByLevel;
  608.                         AdjustSwitch(DeleteByLevelSwitch, DeleteByLevel)
  609.                     end;
  610.  
  611.                 SkipDeletesSwitch: 
  612.                     begin { SkipDeletes switch    }
  613.                         SkipDeletes := not SkipDeletes;
  614.                         AdjustSwitch(SkipDeletesSwitch, SkipDeletes)
  615.                     end;
  616.  
  617.                 SortUserlogSwitch: 
  618.                     begin { SortUl switch    }
  619.                         SortUl := not SortUl;
  620.                         AdjustSwitch(SortUserlogSwitch, SortUl)
  621.                     end;
  622.  
  623.                 ZeroMinSwitch: 
  624.                     begin { ZeroMin switch    }
  625.                         ZeroMin := not (ZeroMin);
  626.                         getDItem(theDialog, ZeroMinSwitch, itemType, itemHandle, dispRect);
  627.                         thisButton := ControlHandle(itemHandle);
  628.                         if ZeroMin then
  629.                             SetCtlValue(thisButton, Selected)
  630.                         else
  631.                             SetCtlValue(thisButton, Unselected)
  632.                     end;
  633.  
  634.                 ResetCLSwitch: 
  635.                     begin { ResetCL switch    }
  636.                         ResetCL := not (ResetCL);
  637.                         getDItem(theDialog, ResetCLSwitch, itemType, itemHandle, dispRect);
  638.                         thisButton := ControlHandle(itemHandle);
  639.                         if ResetCL then
  640.                             begin
  641.                                 SetCtlValue(thisButton, Selected);
  642.                                 AdjustActive(MonthlyCLArcSwitch, true);
  643.                                 MonthlyCLArc := true
  644.                             end
  645.                         else
  646.                             begin
  647.                                 SetCtlValue(thisButton, Unselected);
  648.                                 AdjustActive(MonthlyCLArcSwitch, false);
  649.                                 MonthlyCLArc := false
  650.                             end;
  651.                     end;
  652.  
  653.                 ResetTLSwitch: 
  654.                     begin { ResetTL switch    }
  655.                         ResetTL := not (ResetTL);
  656.                         getDItem(theDialog, ResetTLSwitch, itemType, itemHandle, dispRect);
  657.                         thisButton := ControlHandle(itemHandle);
  658.                         if ResetTL then
  659.                             begin
  660.                                 SetCtlValue(thisButton, Selected);
  661.                                 AdjustActive(TabbyLimitSwitch, true);
  662.                                 AdjustActive(MonthlyTLArcSwitch, true);
  663.                                 AdjustActive(TabbyKLimitRadio, true);
  664.                                 AdjustActive(TabbyDayLimitRadio, true);
  665.                                 if TLKLimit then
  666.                                     getDItem(theDialog, TabbyDayLimitRadio, itemType, itemHandle, dispRect)
  667.                                 else
  668.                                     getDItem(theDialog, TabbyKLimitRadio, itemType, itemHandle, dispRect);
  669.                                 SetCtlValue(ControlHandle(itemHandle), Unselected);
  670.                                 TabbyLimit := true
  671.                             end
  672.                         else
  673.                             begin
  674.                                 SetCtlValue(thisButton, Unselected);
  675.                                 AdjustActive(TabbyLimitSwitch, false);
  676.                                 AdjustActive(MonthlyTLArcSwitch, false);
  677.                                 AdjustActive(TabbyKLimitRadio, false);
  678.                                 AdjustActive(TabbyDayLimitRadio, false);
  679.                                 TabbyLimit := false
  680.                             end
  681.                     end;
  682.  
  683.                 MonthlyTLArcSwitch: 
  684.                     begin
  685.                         MonthlyTLArc := not MonthlyTLArc;
  686.                         AdjustSwitch(MonthlyTLArcSwitch, MonthlyTLArc)
  687.                     end;
  688.  
  689.                 StuffItSwitch: 
  690.                     begin
  691.                         UseStuffit := not UseStuffit;
  692.                         AdjustSwitch(StuffItSwitch, UseStuffit)
  693.                     end;
  694.  
  695.                 ChangeLevelSwitch: 
  696.                     begin { ChangeLevel users switch    }
  697.                         ChangeLevel := not (ChangeLevel);
  698.                         AdjustSwitch(ChangeLevelSwitch, ChangeLevel)
  699.                     end;
  700.  
  701.                 TabbyLimitSwitch: 
  702.                     begin { TabbyLimit  switch    }
  703.                         TabbyLimit := not (TabbyLimit);
  704.                         AdjustSwitch(TabbyLimitSwitch, TabbyLimit)
  705.                     end;
  706.  
  707.                 MonthlyCLArcSwitch: 
  708.                     begin { Monthly CL Archive  switch    }
  709.                         MonthlyCLArc := not (MonthlyCLArc);
  710.                         AdjustSwitch(MonthlyCLArcSwitch, MonthlyCLArc)
  711.                     end;
  712.  
  713.                 DeleteOldUsersSwitch: 
  714.                     begin { Delete Old Users  switch    }
  715.                         DeleteOldUsers := not DeleteOldUsers;
  716.                         AdjustSwitch(DeleteOldUsersSwitch, DeleteOldUsers)
  717.                     end;
  718.  
  719.                 LogDeletesSwitch: 
  720.                     begin { Log Deletes  switch    }
  721.                         LogDeletes := not (LogDeletes);
  722.                         AdjustSwitch(LogDeletesSwitch, LogDeletes)
  723.                     end;
  724.  
  725.                 VeteranCallerSwitch: 
  726.                     begin
  727.                         AlterVeterans := not (AlterVeterans);
  728.                         AdjustSwitch(VeteranCallerSwitch, AlterVeterans)
  729.                     end;
  730.  
  731.                 FlagSetRadio: 
  732.                     begin
  733.                         SetTheFlag := true;
  734.                         AdjustSwitch(FlagSetRadio, true);
  735.                         AdjustSwitch(FlagClearRadio, false)
  736.                     end;
  737.  
  738.                 FlagClearRadio: 
  739.                     begin
  740.                         SetTheFlag := false;
  741.                         AdjustSwitch(FlagSetRadio, false);
  742.                         AdjustSwitch(FlagClearRadio, true)
  743.                     end;
  744.  
  745.                 TabbyKLimitRadio: 
  746.                     begin
  747.                         TLKLimit := true;
  748.                         AdjustSwitch(TabbyKLimitRadio, true);
  749.                         AdjustSwitch(TabbyDayLimitRadio, false)
  750.                     end;
  751.  
  752.                 TabbyDayLimitRadio: 
  753.                     begin
  754.                         TLKLimit := false;
  755.                         AdjustSwitch(TabbyKLimitRadio, false);
  756.                         AdjustSwitch(TabbyDayLimitRadio, true)
  757.                     end;
  758.  
  759.                 KillOneTimersSwitch: 
  760.                     begin { Kill Old One-Time Callers  switch    }
  761.                         KillOldOneCalls := not KillOldOneCalls;
  762.                         AdjustSwitch(KillOneTimersSwitch, KillOldOneCalls)
  763.                     end;
  764.  
  765.                 FindButton: 
  766.                     begin
  767.                         where.h := 60;
  768.                         where.v := 80;
  769.                         SFPPutFile(where, 'Select backup location', 'Click to select', nil, fileReply, 3999, nil);
  770.                         if fileReply.good then
  771.                             begin
  772.                                 MakePath(fileReply.fname, fileReply.vRefNum, BackupPath);
  773.                                 getDItem(theDialog, BackupPathField, itemType, itemHandle, dispRect);
  774.                                 SetIText(itemHandle, BackupPath);
  775.                             end;
  776.                         FrameDItem(theDialog, Ok);
  777.                     end;
  778.  
  779.                 otherwise
  780.                     ;    {    do nothing    }
  781.  
  782.             end;
  783.         until (ItemHit = OK) | (ItemHit = Cancel);
  784.         DisposDialog(theDialog)
  785.     end;
  786. end.